import axiosApi from '../../AxiosApi.js'

const apiList = {
  createTemplate: {
    method: 'post',
    url: `/api/v1/tpl`
  },
  templateList: {
    method: 'post',
    url: `/api/v1/tpl/query`
  },
  templateDetails: {
    method: 'get',
    url: `/api/v1/tpl/details`
  },
  editTemplate: {
    method: 'put',
    url: `/api/v1/tpl`
  },
  deleteTemplate: {
    method: 'delete',
    url: `/api/v1/tpl`
  },
  cloneTemplate: {
    method: 'post',
    url: `/api/v1/tpl/clone/`
  },
}


export default {
  cloneTemplate(id) {
    return axiosApi({
      url: apiList.cloneTemplate.url+id,
      method: apiList.cloneTemplate.method
    })
  },
  deleteTemplate (data) {
    return axiosApi({
      ...apiList.deleteTemplate,
      data
    })
  },
  editTemplate (data) {
    return axiosApi({
      ...apiList.editTemplate,
      data
    })
  },
  templateDetails (data) {
    return axiosApi({
      ...apiList.templateDetails,
      data
    })
  },
  templateList (data) {
    return axiosApi({
      ...apiList.templateList,
      data
    })
  },
  createTemplate (data) {
    return axiosApi({
      ...apiList.createTemplate,
      data
    })
  },
}
